package com.sumainfor.pc.market.service;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.dao.SeHousingInfoMapper;
import com.sumainfor.pc.market.dao.SeHousingMapper;
import com.sumainfor.pc.market.feign.Zfeign.ZzuulFeign;
import org.apache.commons.collections.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;

/**
 * 服务中心经理房源定价
 */
@Service
public class SeHousingService implements Serializable {

    private ReentrantLock lock = new ReentrantLock(false);

    Logger log = LoggerFactory.getLogger(SeHousingService.class);// 日志

    @Autowired
    private SeHousingMapper seHousingMapper;
    /**
     * 查询房源的整租建议价
     */
    public Map<String,Object> getSeHousingGrossMargin(Map<String, Object> params){
        //查询收房专员收房时间和当前时间的年份差
        Map<String,Object> map=seHousingMapper.getSeHousingYeardifference(params);
        System.out.println("查询到的map:"+map);
        if (map.get("yearCount")!=null){
            params.putAll(map);
            System.out.println("查询之前的参数:"+params);
            Map<String,Object> sjkMap= seHousingMapper.getSeHousingGrossMargin(params);
            System.out.println(sjkMap);
            return  sjkMap;
        }else{
            return null;
        }

    }
}
